﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Reservation : System.Web.UI.Page
{
    Connectdbnour con = new Connectdbnour();
    protected void Page_Load(object sender, EventArgs e)
    {
        Label1.Text = GlobalClass.DT;
        Label2.Text = GlobalClass.Client;
    }
    protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (DropDownList2.SelectedItem.ToString() == "CL. Directly" || DropDownList2.SelectedItem.ToString() == "CL. After Med. Test")
        {
            DropDownList3.Enabled = true;
            DropDownList4.Enabled = true;
            DropDownList5.Enabled = true;
            DropDownList6.Enabled = true;
            DropDownList7.Enabled = true;
            DropDownList8.Enabled = true;
            DropDownList9.Enabled = true;
            DropDownList10.Enabled = false;
            DropDownList11.Enabled = false;
            DropDownList12.Enabled = false;
            DropDownList13.Enabled = false;
        }
        else
        {
            DropDownList3.Enabled = false;
            DropDownList4.Enabled = false;
            DropDownList5.Enabled = false;
            DropDownList6.Enabled = false;
            DropDownList7.Enabled = false;
            DropDownList8.Enabled = false;
            DropDownList9.Enabled = false;
            DropDownList10.Enabled = true;
            DropDownList11.Enabled = true;
            DropDownList12.Enabled = true;
            DropDownList13.Enabled = true;
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (DropDownList2.SelectedItem.ToString() == "CL. Directly" || DropDownList2.SelectedItem.ToString() == "CL. After Med. Test")
        {
            con.Addrsvlens(DropDownList11.SelectedItem.ToString(), Label1.Text, Convert.ToInt32(Label2.Text), DropDownList2.SelectedItem.ToString(), DropDownList3.SelectedItem.ToString(), DropDownList4.SelectedItem.ToString(), Convert.ToDouble(DropDownList5.SelectedItem.ToString()), Convert.ToDouble(DropDownList6.SelectedItem.ToString()), Convert.ToDouble(DropDownList7.SelectedItem.ToString()), Convert.ToDouble(DropDownList8.SelectedItem.ToString()), Convert.ToDouble(DropDownList9.SelectedItem.ToString()), Convert.ToInt16(TextBox1.Text), Convert.ToInt16(TextBox2.Text));
        }
        else
        {
            con.Addrsvdr(DropDownList11.SelectedItem.ToString(), Label1.Text, Convert.ToInt32(Label2.Text), DropDownList2.SelectedItem.ToString(), DropDownList13.SelectedItem.ToString(), DropDownList11.SelectedItem.ToString() + "-" + DropDownList10.SelectedItem.ToString() + "-" + DropDownList12.SelectedItem.ToString(), Convert.ToInt16(TextBox1.Text), Convert.ToInt16(TextBox2.Text));
        }
    }
}